package com.ptu.spzx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ptu.spzx.domain.Question.Vo.QuestionVO;
import com.ptu.spzx.domain.Question.po.Question;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.*;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author YT
 * @since 2024-01-28
 */
@Mapper
public interface QuestionMapper extends BaseMapper<Question> {

    @Update("UPDATE question set question_used = question_used+1 WHERE question_id=#{questionId}")
    Integer updateByKnowIdUse(Long questionId);

    @Update("UPDATE question set used_time = #{formattedDateTime} WHERE question_id=#{parentId}")
    void updateUserTime(String formattedDateTime,Long parentId);

//    @Update("UPDATE question SET used_time = #{formattedDateTime} WHERE question_id IN (#{parentId})")
//    void updateUserTime2(String formattedDateTime,List<Long> parentId);
}
